import requestProxy from '@/utils/request';
const { request } = requestProxy;

// 外采额度申请tab列表
export function tabList(params) {
  return request({
    url: '/admin/externalHarvest/tab',
    method: 'get',
    params
  });
}
// 外采额度申请列表
export function externalHarvestList(params, cancelToken) {
  return request({
    url: '/admin/externalHarvest/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 外采额度申请删除
export function deleteExternalHarvest(id) {
  return request({
    url: `/admin/externalHarvest/delete/${id}`,
    method: 'delete'
  });
}
// 外采额度申请详情
export function externalHarvestInfo(id) {
  return request({
    url: `/admin/externalHarvest/detail/${id}`,
    method: 'get'
  });
}
// 外采额度申请 - 创建
export function externalHarvestCreate(data) {
  return request({
    url: '/admin/externalHarvest/create',
    method: 'post',
    data
  });
}
// 外采额度申请 - 编辑
export function externalHarvestEdit(id, data) {
  return request({
    url: '/admin/externalHarvest/edit/' + id,
    method: 'put',
    data
  });
}
// 外采额度申请 - 流程
export function formSubmit(data) {
  return request({
    url: '/admin/externalHarvest/formSubmit',
    method: 'post',
    data
  });
}

// 外采额度申请-发表评论
export function externalHarvestCommentAdd(data) {
  return request({
    url: `/admin/externalHarvest/comments/add`,
    method: 'post',
    data
  });
}
// 评论列表
export function externalHarvestComments(params) {
  return request({
    url: '/admin/externalHarvest/comments/list',
    method: 'get',
    params
  });
}
// 外采额度申请 - 流程 - 撤销
export function externalHarvestProcessRevocation(data) {
  return request({
    url: '/admin/externalHarvest/process/revocation',
    method: 'post',
    data
  });
}
// 外采额度申请 - 流程 - 撤回
export function externalHarvestProcessRecall(data) {
  return request({
    url: '/admin/externalHarvest/process/recall',
    method: 'post',
    data
  });
}
// 外采额度申请-流程审批
export function externalHarvestProcessAudit(data) {
  return request({
    url: '/admin/externalHarvest/process/audit',
    method: 'post',
    data
  });
}

// 用户销售信息
export function getUsrSalesInfo(params) {
  return request({
    url: '/admin/user/Sales/info',
    method: 'get',
    params
  });
}
// 外采额度申请 - 详情编辑
export function externalHarvestDetailEdit(data) {
  return request({
    url: '/admin/externalHarvest/detail/edit',
    method: 'put',
    data
  });
}
